package com.sms.domain.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;

import com.sms.common.BaseEntity;

/**
 * @desc 应用实体
 * @author wjw
 * @time 2017年11月16日下午3:31:26
 */
@Entity
@Table(name = "b_application")
public class Application extends BaseEntity {
    
    private static final long serialVersionUID = -936203994181527906L;
    
    /** 主键id，也是appId */
    @Id
    @GeneratedValue(generator = "UIDGenerator")
    @GenericGenerator(name = "UIDGenerator", strategy = "com.sms.common.persistence.UIDGenerator")
    @Column(length = 40)
    private String appId;
    
    /** 应用名 */
    @NotNull(message = "应用名不能为空")
    @NotBlank(message = "应用名不能为空")
    @Column(length = 40)
    private String name;
    
    /** 应用描述 */
    @Column(length = 500)
    private String description;
    
    /** 私钥 */
    @Column(length = 100, updatable = false)
    private String secretKey;
    
    /** 发送通道 */
    private String channelId;
    
    /**
     * 构造函数
     */
    public Application() {
    }
    
    /**
     * 构造函数
     * @param applicationId x
     */
    public Application(String appId) {
        this.appId = appId;
    }
    
    
    public String getAppId() {
		return appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getSecretKey() {
        return secretKey;
    }
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getChannelId() {
        return channelId;
    }
    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }
    
}
